#include <math.h>
#include <stdio.h>

//https://blog.csdn.net/weixin_42253523/article/details/84379315
int main()
{
    int a, b, k, temp;
    while (scanf("%d %d", &a, &b) != EOF)
    {
        //始终让 b < a
        if (a > b)
        {
            temp = b;
            b = a;
            a = temp;
        }
        //两者作差
        k = b - a;
        //公式
        temp = (floor)(k * (1.0 + sqrt(5)) / 2.0);
        
        if (temp == a)
            printf("0\n");
        else
            printf("1\n");
    }
    return 0;
}